home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / other / h2a / Nsubrs.c < prev    next >
C/C++ Source or Header  |  1991-02-25  |  609b  |  35 lines

  1. #define Index2node    INDEX2NODE
  2.  
  3. #include "nsubrs.c"
  4.  
  5. #undef Index2node
  6.  
  7. nptr Index2node( index )
  8.   Ulong  index;
  9.   {
  10.     nptr  n = INDEX2NODE( index );
  11.     if( n == NULL )
  12.       {
  13.     static nptr    node = NULL;
  14.     static char    buff[30];
  15.     register Uint  ma, mi;
  16.  
  17.     ma = index & ((1 << NBIT_HASH) - 1);
  18.     mi = index >> NBIT_HASH;
  19.  
  20.     (void) sprintf( buff, "<%d,%d>", ma, mi );
  21.  
  22.     if( node == NULL )
  23.         node = GetNewNode( "?" );
  24.     if( do_sort )
  25.       {
  26.         node->nname = Valloc( strlen( buff ) + 1, 1 );
  27.         (void) strcpy( node->nname, buff );
  28.       }
  29.     else
  30.         node->nname = buff;
  31.     n = node;
  32.       }
  33.     return( n );
  34.   }
  35.